class LoginToken {
  int code;
  String msg;
  Data data;

  LoginToken({this.code, this.msg, this.data});

  LoginToken.fromJson(Map<String, dynamic> json) {
    if (json["code"] is int) this.code = json["code"];
    if (json["msg"] is String) this.msg = json["msg"];
    if (json["data"] is Map)
      this.data = json["data"] == null ? null : Data.fromJson(json["data"]);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["code"] = this.code;
    data["msg"] = this.msg;
    if (this.data != null) data["data"] = this.data.toJson();
    return data;
  }
}

class Data {
  String token;
  String refreshToken;
  String tokenHead;
  int expiresIn;
  Ext ext;

  Data(
      {this.token,
      this.refreshToken,
      this.tokenHead,
      this.expiresIn,
      this.ext});

  Data.fromJson(Map<String, dynamic> json) {
    if (json["token"] is String) this.token = json["token"];
    if (json["refreshToken"] is String)
      this.refreshToken = json["refreshToken"];
    if (json["tokenHead"] is String) this.tokenHead = json["tokenHead"];
    if (json["expiresIn"] is int) this.expiresIn = json["expiresIn"];
    if (json["ext"] is Map)
      this.ext = json["ext"] == null ? null : Ext.fromJson(json["ext"]);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["token"] = this.token;
    data["refreshToken"] = this.refreshToken;
    data["tokenHead"] = this.tokenHead;
    data["expiresIn"] = this.expiresIn;
    if (this.ext != null) data["ext"] = this.ext.toJson();
    return data;
  }
}

class Ext {
  int defaultAccountBookId;
  int userType;
  String userName;
  int userId;
  String userCode;

  Ext(
      {this.defaultAccountBookId,
      this.userType,
      this.userName,
      this.userId,
      this.userCode});

  Ext.fromJson(Map<String, dynamic> json) {
    if (json["defaultAccountBookId"] is int)
      this.defaultAccountBookId = json["defaultAccountBookId"];
    if (json["userType"] is int) this.userType = json["userType"];
    if (json["userName"] is String) this.userName = json["userName"];
    if (json["userId"] is int) this.userId = json["userId"];
    if (json["userCode"] is String) this.userCode = json["userCode"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["defaultAccountBookId"] = this.defaultAccountBookId;
    data["userType"] = this.userType;
    data["userName"] = this.userName;
    data["userId"] = this.userId;
    data["userCode"] = this.userCode;
    return data;
  }
}
